import pygame
from game import Game


class Text:
    def __init__(self, text: str, text_color, x: int, y: int, font_size: int):
        self.x = x
        self.y = y
        self.text_color = text_color
        self.text = text
        self.font_size = font_size
        self.font = pygame.font.Font('font/datouren.ttf', self.font_size)
        self.botton_text = self.font.render(self.text, True, self.text_color)

    def display_text(self):
        Game.window.blit(self.botton_text, (self.x, self.y))

    def display_text_star(self, text: str, x: int, y: int, font_size: int):
        self.x = x
        self.y = y
        self.text = text
        self.font_size = font_size
        self.font = pygame.font.Font('font/datouren.ttf', self.font_size)
        self.botton_text = self.font.render(self.text, True, self.text_color)
        Game.window.blit(self.botton_text, (self.x, self.y))
